#ifndef GAMECAMERA_H
#define GAMECAMERA_H

#include <OgreCamera.h>
#include "MoveableObject.h"

class GameCamera
{
public:
	GameCamera(Ogre::Camera *camera, Ogre::RenderWindow *window, float minDistance = 5, float maxDistance = 8);
	~GameCamera(void);
	bool init(MoveableObjectPtr object);
	void update(const unsigned long elapsedTime);
	void reset(void);
	void updateAspectRatio(void);
	Ogre::Camera *getCamera(void) const;
	float getMinDistance(void) const;
	float getMaxDistance(void) const;
	void setMinDistance(const float distance);
	void setMaxDistance(const float distance);
private:
	Ogre::Camera *mpCamera;
	Ogre::Viewport *mpViewport;
	MoveableObjectPtr mpTrackedObject;
	float mfMinDistance;
	float mfMaxDistance;
	float mfLastDistance;
	bool mInitialized;
	bool mReseted;
	//std::list<const Ogre::Vector3> mLookAtZList;
	std::list<const Ogre::Vector3> mCharXAxisList;
	std::list<const Ogre::Vector3> mLookAtCamList;
};

#endif